Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2009 at 03:17 UTC
Updated:
12 Nov 2009 at 19:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
neclimdulTry 2 with a base_table check.
Comment #2
neclimdulFixed bug where false wasn't set when set_distinct was called and an access module was present. Better docs.
Comment #3
neclimdulAccidently fudged the parameters of the outer if at some point. replace them.
Comment #4
karens commentedLooks good to me!! I'll be happy to see this nasty bug get a work-around :)
Comment #5
merlinofchaos commentedCommitted to 2.x. We're going to need a reroll against the 3.x branch.
Comment #6
dawehnerhere is a fast rerole
Comment #7
igama commentedI have:
Latest Drupal 6
Views 6.x-2.x-dev 2009-Jun-26
Workflow 6.x-1.1
I had the SQL error when I would try and activate the Distinct ( SELECT DISTINCT(node.nid) AS DISTINCT(node.nid)....) , and then I updated to the latest dev View and now I get no error, but the duplicates are still there.
There is no "DISTINCT(node.nid)" in the SQL.
SELECT node.nid AS nid,
node_data_field_image.field_image_fid AS node_data_field_image_field_image_fid,
node_data_field_image.field_image_list AS node_data_field_image_field_image_list,
node_data_field_image.field_image_data AS node_data_field_image_field_image_data,
node.type AS node_type,
node.vid AS node_vid,
term_data.name AS term_data_name,
term_data.vid AS term_data_vid,
term_data.tid AS term_data_tid,
node.title AS node_title,
vocabulary.name AS vocabulary_name,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node.sticky AS node_sticky,
node_data_field_date.field_date_value AS node_data_field_date_field_date_value,
DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL 28800 SECOND), '%Y%m%d%H%i') AS node_created_minute
FROM node node
LEFT JOIN workflow_node workflow_node ON node.nid = workflow_node.nid
LEFT JOIN content_field_image node_data_field_image ON node.vid = node_data_field_image.vid
LEFT JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
LEFT JOIN vocabulary vocabulary ON term_data.vid = vocabulary.vid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
LEFT JOIN content_field_date node_data_field_date ON node.vid = node_data_field_date.vid
WHERE (node.type in ('equipamento')) AND (node.status <> 0 OR (node.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1) AND (workflow_node.sid = 4)
ORDER BY node_sticky DESC, node_data_field_date_field_date_value DESC, node_created_minute DESC, node_title ASC
Comment #8
merlinofchaos commentedFrom the help text on the distinct setting:
Please actually read stuff before you post and change the status of issues around. It doesn't always work. It says so. There's nothing I can do about it. If DISTINCT doesn't do the trick then you need a new approach.
Comment #9
stormsweeper commented#7: With that query, if you have more than one term or file on a node you will get multiple rows for that node, and each will be distinct as far as the db is concerned.
Comment #10
merlinofchaos commentedCommitted to 3.x line too. Thanks!
Comment #12
agentrickardI think 6.14 may have broken this. See #284392: db_rewrite_sql causing issues with DISTINCT, comments after #154.
Comment #13
ken54671 commentedPatch for Views 6.x-2.6.
Comment #14
ken54671 commentedA cleaner implementation of #13. Patch for Views 6.x-2.6.
Comment #15
ken54671 commentedA cleaner implementation of #13. Patch for Views 6.x-2.6.
Comment #16
dummas_324324_32 commentedIt works!!! very nice work..
The weekend can start!
Comment #17
Frank Steiner commentedWorks fine for the problen with 6.14 and -2.x.
Comment #18
izmeez commentedsubscribe
Comment #19
merlinofchaos commentedI need a patch that works with both 6.13 and 6.14 -- because I can't guarantee that anybody will be running a particular version.
Comment #20
merlinofchaos commentedActually: Please post the patch in http://drupal.org/node/579892 instead and return this to its original state.
Comment #21
agentrickard6.14 was a security release, so we can force people to be on that version, yes?
Comment #22
izmeez commentedI applied the patch in #15 to the latest 6.x-2.x-dev version and it has solved the problems of duplicates and triplicates in Drupal 6.14
Thanks,
Izzy
Comment #23
ken54671 commentedClosing this issue since these workarounds are for versions of Drupal before 6.14.
If you are using Drupal 6.14, please see Authors and only authors see dupplicate items after upgrading Drupal to 6.14 and db_rewrite_sql causing issues with DISTINCT.
Comment #24
damien tournoud commentedI do not get the patch that went in (#3): why *in hell* do you prevent distinct for being set if the base table is not node?
Comment #25
R.Hendel commentedsubscribe
Comment #26
Ole Martin commentedAnd where to put this patch ?
Comment #27
merlinofchaos commentedDamZ is right. It should prevent distinct from being set if the base table is 'node'.
The original patch here needs to be reverted.
Comment #28
merlinofchaos commentedOriginal patch reverted from 2.x and 3.x versions.
Comment #29
Leeteq commentedSubscribing.
Comment #30
damien tournoud commentedThis is now taken care of in #579892: Authors and only authors see duplicate items after upgrading Drupal to 6.14.